<? 
	include('base.php');
	User::protect();
	$section = 'band_news';
	include_class('band_members');
	include_class('band_news');
	$page_title = 'Add/Edit Band News';
	$nl = new BandNewsList();
	$newslist = $nl->get_band_news($_GET['entries_per_page'], $_GET['start']);
	$news_total = $nl->get_total();
	include('layout/header.php');
?>

<div id="breadcrumb">
	<a href="index.php">Audition&nbsp;&#62;</a>&nbsp;<a href="band.php">Manage&nbsp;Band&nbsp;&#62;</a>&nbsp;Band News
</div>

	<?
		if (db::isError($newslist)) {
			$newslist->outputList();
		} 
	?>
	
	<h1>band news:</h1>
	<div class="inset">
	<p>
	<form id="amount_form" action="<?=$PHP_SELF?>" method="get">
		<a href="band_news_add.php">Add Entry</a><span class="padded">|</span>
		<? include('layout/paging.php'); ?>
	</form>
	</p>
	<p>
	<table class="list" border="0" cellspacing="1" cellpadding="0">
	<tr>
		<td class="header" colspan="2">Date/Time</td>
		<td class="header">Headline</td>
		<td class="header">Posted By</td>
	</tr>
	<? 
		if (is_array($newslist) && count($newslist) > 0) { 
		foreach ($newslist as $no) { ?>
		<tr>
			<td valign="top"><?=$no->getDate()?></td>
			<td valign="top"><?=$no->getTime()?></td>
			<td valign="top" width="50%"><a href="band_news_edit.php?id=<?=$no->getID()?>"><?=$no->getTitle()?></a><? if (!$no->isActive()) { ?> <img src="images/inactive.gif" alt="Entry is Inactive" width="10" height="10" title="Entry is Inactive"><? } ?></td>
			<td valign="top" width="20%"><?
				$uo = $no->getUserObject();
				echo $uo->getFirstName();
			?>
			</td>
		</tr>				
		<? 
		}
		} else {?>
		<tr>
			<td colspan="4">No entries</td>
		</tr>
	<? }
	?>
	</table>
	</p>		
	</div>

<? include('layout/footer.php'); ?>
